package com.momei.common.utils;

import com.momei.common.entity.JsonResult;
import com.momei.common.enums.ResultCode;

/**
 *@description: 返回实体生成工具
 *@author: momo
 *@time: 2020/9/11
 */
public class ResultTool {
    public static JsonResult success() {
        return new JsonResult(true);
    }

    public static <T> JsonResult<T> success(T data) {
        return new JsonResult(true, data);
    }

    public static JsonResult fail() {
        return new JsonResult(false);
    }

    public static JsonResult fail(ResultCode resultEnum) {
        return new JsonResult(false, resultEnum);
    }
}
